var jobReference = {
    currentJobReferencePageNo:0,
    list:function(page){
        $.ajax({
            type: "GET",
            url: config.baseURL + "jobReference/list.json",
            cache:false,
            dataType: "json",
            data : {"currentPage":page + 1,"perPageSize":4},
            success: function(data){
                if(data.result == 'success'){
                    $('#jobReferenceList').html("");

                    $.each(data.jobReferenceList, function(index, obj) {
                        var html = '<li><img src="'+config.baseURL+obj.imagePath+'"/>'+obj.subject+'' +
                        		'<div style="height:40px;overflow:hidden;">Light soure:'+obj.lightSoure+'</div></li>';
                            
                        $('#jobReferenceList').append(html);
                    });
                    
                    if(data.jobReferenceListCount==0){
                        $('#productList').append('<li class="nodata">nodata</li>');
                    }else{
                        $("#paginationDiv").pagination(data.jobReferenceListCount, {
                            callback: jobReference.list,//回调函数
                            num_display_entries: 20,
                            num_edge_entries: 12,
                            items_per_page:4,//每页显示多少条
                            current_page:page,//当前页码
                            prev_show_always:false,
                            next_show_always:false
                        });
                    }
                    
                    if(data.jobReferenceListCount>4){
                        $("#paginationDiv").show();
                    }else{
                        $("#paginationDiv").hide();
                    }
                    
                    currentJobReferencePageNo = page;
                }else{
                    $.msgBox.alert({
                        title:'Tips',
                        msg:'System error!Please try again later!',
                        icon:'warning',
                        width:350
                    });
                }
            }
        });
    }
};